extern filter_vecs_t stackfilt_vecs;
extern filter_vecs_t trackfilter_vecs;
extern filter_vecs_t discard_vecs;
+extern filter_vecs_t nuke_vecs;
static
fl_vecs_t filter_vec_list[] = {
"discard",
"Remove unreliable points with high hdop or vdop"
},
+ {
+ &nuke_vecs,
+ "nuketypes",
+ "Remove all waypoints, tracks, or routes"
+ },
{
NULL,
NULL,
--- /dev/null
+/*
+
+ nukedata: remove all (waypoint|tracks|routes) from the stream.
+
+ Copyright (C) 2005 Robert Lipe robertlipe@usa.net
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
+
+ */
+
+#include "defs.h"
+#include "filterdefs.h"
+
+#define MYNAME "nukedata"
+
+static char *nukewpts, *nuketrks, *nukertes;
+
+static
+arglist_t nuke_args[] = {
+ {"waypoints", &nukewpts, "Remove all waypoints from data stream.",
+ "0", ARGTYPE_BOOL} ,
+ {"tracks", &nuketrks, "Remove all tracks from data stream.",
+ "0", ARGTYPE_BOOL} ,
+ {"routes", &nukertes, "Remove all routes from data stream.",
+ "0", ARGTYPE_BOOL} ,
+ {0, 0, 0, 0, 0}
+};
+
+static void
+nuke_process(void)
+{
+ if (nukewpts) {
+ waypt_flush_all();
+ }
+ if (nuketrks) {
+ route_flush_all_tracks();
+ }
+ if (nukertes) {
+ route_flush_all_routes();
+ }
+}
+
+filter_vecs_t nuke_vecs = {
+ NULL,
+ nuke_process,
+ NULL,
+ NULL,
+ nuke_args
+};
+
common_disp_all(&my_track_head, rh, rt, wc);
}
-void
-route_flush(queue *head)
+static void
+route_flush_q(queue *head)
{
queue *elem, *tmp;
queue *q;
}
void
-route_flush_all()
+route_flush_all_routes(void)
{
- route_flush(&my_route_head);
- route_flush(&my_track_head);
+ route_flush_q(&my_route_head);
rte_head_ct = 0;
- trk_head_ct = 0;
rte_waypts = 0;
}
+void
+route_flush_all_tracks(void)
+{
+ route_flush_q(&my_track_head);
+ trk_head_ct = 0;
+}
+
+void
+route_flush_all()
+{
+ route_flush_all_tracks();
+ route_flush_all_routes();
+}
+
void
route_backup(unsigned int *count, queue **head_bak)
{
{
if (head_bak == NULL) return;
- route_flush(&my_route_head);
+ route_flush_q(&my_route_head);
QUEUE_INIT(&my_route_head);
QUEUE_MOVE(&my_route_head, head_bak);
xfree(head_bak);
{
if (head_bak == NULL) return;
- route_flush(&my_track_head);
+ route_flush_q(&my_track_head);
QUEUE_INIT(&my_track_head);
QUEUE_MOVE(&my_track_head, head_bak);
xfree(head_bak);